-
-
Notifications
You must be signed in to change notification settings - Fork 12
feat: add mouse support #49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
My god, this is great! |
|
Please take another look! The bubblezone dependency requires Go 1.23.0. When I ran go get github.com/lrstanley/bubblezone, it automatically upgraded. |
dlvhdr
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good! I left some suggestions for you to think about. Let me know what you think and how we should proceed.
7755272 to
bf5dd1b
Compare
|
I fixed the conflicts with a rebase and then I would recommend to set |
- Click on files in the tree to select them - Scroll wheel works in both file tree and diff viewer panes - Drag the border between panes to resize sidebar
- Add bubblezone dependency for zone-based click detection - Mark UI zones (searchbox, filetree, searchresults, diffviewer) - Replace coordinate-based checks with zone.InBounds() - Use zone.Pos() for relative coordinates in click handlers - Keep hybrid approach for sidebar resize (coordinate-based) - Update FileNode to implement new tree.Node interface
Add SetCursorNoScroll method to filetree that updates selection without scrolling the viewport. Use it in handleFileTreeClick so the view stays in place when clicking a visible file.
Consolidate duplicate root-hidden checks into a single reusable method. Also fixes inconsistency where one check used '.' and another used dirIcon+'.' - now all use the correct dirIcon+'.' check.
When user drags sidebar width below 10px, automatically hide it. Pressing 'e' to show the tree again resets to default width (26).
Allow dragging the sidebar back open by clicking and dragging the thin vertical line that remains when sidebar is hidden.
Add constants for sidebar constraints and scroll speed: - sidebarMinWidth (20) - sidebarHideWidth (10) - scrollLines (3) Also add comment explaining Width(0) for grab line.
bf5dd1b to
dad63d1
Compare
|
I resolved the conflicts, please take another look. |
that's my bad. I haven't set the repo properly (it's new compared to my others). |
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [dlvhdr/diffnav](https://github.com/dlvhdr/diffnav) | minor | `v0.3.1` → `v0.4.0` | MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot). **Proposed changes to behavior should be submitted there as MRs.** --- ### Release Notes <details> <summary>dlvhdr/diffnav (dlvhdr/diffnav)</summary> ### [`v0.4.0`](https://github.com/dlvhdr/diffnav/releases/tag/v0.4.0) [Compare Source](dlvhdr/diffnav@v0.3.1...v0.4.0) ### Switch focus between panes, config file, mouse support and more! This release is brought to you by [@​pablospe](https://github.com/pablospe) who made some serious improvements across the board! Thank you [@​pablospe](https://github.com/pablospe), your work is really appreciated! <3 #### Focus Switching You can now switch focus between the file tree and the diff by hitting <kbd>tab</kbd>. This lets you use a wider set of movement keybinds like actually navigating one line at a time with <kbd>j/k</kbd>. #### Config File `diffnav` now has a config file (check the readme on how to set it up). It lets you hide the footer/header, hide the file tree by default or set its width. #### Mouse Support You can now click the files in the tree or scroll the diff with your mouse! Again, this was all done by [@​pablospe](https://github.com/pablospe) so give him some love! #### Changelog - [`ccb29e8`](dlvhdr/diffnav@ccb29e8) Revert "fix: prevent j/k from scrolling inactive panel" - [`3a431de`](dlvhdr/diffnav@3a431de) chore: add funding configuration for GitHub - [`37a52c1`](dlvhdr/diffnav@37a52c1) feat: add config option to hide header - [`e5efc99`](dlvhdr/diffnav@e5efc99) feat: add more config options - [`8d516cd`](dlvhdr/diffnav@8d516cd) feat: add mouse support ([#​49](dlvhdr/diffnav#49)) - [`60f5aa3`](dlvhdr/diffnav@60f5aa3) feat: add panel switching with h/l and arrow keys - [`bfc0ef1`](dlvhdr/diffnav@bfc0ef1) feat: convert config to YAML and nest under ui key - [`600d8ed`](dlvhdr/diffnav@600d8ed) feat: improve config file discovery - [`090abfc`](dlvhdr/diffnav@090abfc) feat: make ctrl+d/ctrl+u global for diff scrolling - [`23b3000`](dlvhdr/diffnav@23b3000) feat: replace h/l panel switching with Tab toggle - [`d6b2e73`](dlvhdr/diffnav@d6b2e73) fix: improve file tree selection styling - [`cad6633`](dlvhdr/diffnav@cad6633) fix: isolate panel navigation to prevent cross-scrolling - [`803f7a8`](dlvhdr/diffnav@803f7a8) fix: prevent delta colors from bleeding into file tree panel - [`a07e104`](dlvhdr/diffnav@a07e104) fix: prevent j/k from scrolling inactive panel - [`f5f8972`](dlvhdr/diffnav@f5f8972) refactor: use ansi.Truncate instead of custom implementation - [`e939dcf`](dlvhdr/diffnav@e939dcf) refactor: use camelCase for config keys - [`08a7356`](dlvhdr/diffnav@08a7356) style: capitalize TAB in footer help </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0Mi43NS4xIiwidXBkYXRlZEluVmVyIjoiNDIuNzUuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90IiwiYXV0b21hdGlvbjpib3QtYXV0aG9yZWQiLCJkZXBlbmRlbmN5LXR5cGU6Om1pbm9yIl19-->


Summary